﻿using Abp.Application.Services.Dto;
using System;
using System.Collections.Generic;

namespace shenghua.Member.Members.Dto
{
    public class MemberDto: EntityDto<long>
    {
        public string UserName { get; set; }
        public string Name { get; set; }
        public string PhoneNumber { get; set; }
        public string EmailAddress { get; set; }

        public string Head { get; set; }
        public string Sex { get; set; }
        public string BirthYear { get; set; }
        public string BirthMonth { get; set; }
        public string BirthDay { get; set; }
        public int TotalXPValue { get; set; }
        public int XPValue { get; set; }
        public int Level { get; set; }
        public Dictionary<string, string> FormItems { get; set; }
        public List<string> Groups { get; set; }
        public string Remark { get; set; }
        public MemberStatus Status { get; set; }
        public DateTime CreationTime { get; set; }

        public MemberDto()
        {
            FormItems = new Dictionary<string, string>();
            Groups = new List<string>();
        }

        public MemberDto(Member member)
        {
            Id = member.Id;
            UserName = member.UserName;
            Name = member.Name;
            PhoneNumber = member.PhoneNumber;
            EmailAddress = member.EmailAddress;

            Head = member.Head;
            Sex = member.Sex;
            BirthYear = member.BirthYear;
            BirthMonth = member.BirthMonth;
            BirthDay = member.BirthDay;
            TotalXPValue = member.TotalXPValue;
            XPValue = member.XPValue;
            Level = member.Level;
            FormItems = member.FormItems;
            Groups = member.Groups.Items;
            Remark = member.Remark;
            Status = member.Status;
            CreationTime = member.CreationTime;
        }
    }
}